/**
 *   For
 *   Created by yt at 2018/5/4
 */
"use strict";
(function () {
    angular.module('app')
        .factory('util',fn);

    function fn() {
        var self = {};
        self.testUsername = function (str) {
            var usernamePattern = /^[a-zA-Z0-9_]{2,16}$/;
            return usernamePattern.test(str);
        };
        self.testPwd = function (str) {
            // "."表示匹配除换行符\n外的任意一个字符
            var pwdPattern = /^.{6,}$/;
            return pwdPattern.test(str);
        };
        self.testPhone = function (str) {
            var phonePattern = /^1[3,4,5,6,7,8][0-9]{9}$/;
            return phonePattern.test(str);
        };

        return self;

    }
})();